(function ($) {
  Drupal.behaviors.initELocations = {
    attach: function(context, settings) {
      $('#e_location_selector', context).click(function () {
        openPopup('wrpChangeELocation',565,$(document).scrollTop()+150);
      });
     
      $('.location-list .location', context).click(function () {
        $.cookie('e_location_ccid', $(this).attr('locid'), {
          path: '/',
          expires: 365
        } );
        location.reload();
      });
    }
  };
})(jQuery);